<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!doctype html>
<html>
<head>
    <%@ include file="/common.jsp" %>
    <%--<link rel="stylesheet" type="text/css" href="../statics/aui/css/aui.css"/>--%>
    <link rel="stylesheet" type="text/css" href="${ctx}/statics/aui/css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx }/css/weui.min.css"/>
    <title>入驻申请</title>

    <script type="text/javascript" src="../statics/libs/jquery.min.js"></script>
    <script type="text/javascript" src="../js/Map.js"></script>
    <script type="text/javascript" src="../statics/libs/vue.min.js"></script>
    <script type="text/javascript">
        var page = window.location.href;
        var url = "<%=request.getContextPath()%>/jsGet";
        var sureUrl = "<%=request.getContextPath()%>/submit";
        var succesUrl = "<%=request.getContextPath()%>/applySuccess";
        var imageUrl;
        var positiveId, oppositeId, innerId, outerId;
        var info;
    </script>


    <style type="text/css">
        .refresh_test {
            font-family: PingFangSC-Regular;
            font-size: 14px;
            color: #128ee9;
            line-height: 21px;
            text-align: center;
        }

        .receivables_error {
            font-family: PingFangSC-Regular;
            font-size: 18px;
            color: #333333;
            text-align: center;
        }

        .receivables_text {
            font-family: PingFangSC-Regular;
            font-size: 15px;
            color: #666666;
            line-height: 30px;
            text-align: right;
        }

        .receivables_amt {
            font-family: PingFangSC-Regular;
            font-size: 20px;
            color: #333333;
            line-height: 21px;
            text-align: right;
        }

        .receivables_999999 {
            font-family: PingFangSC-Regular;
            font-size: 12px;
            color: #999999;
        }

        .receivables_128ee9 {
            font-family: PingFangSC-Regular;
            font-size: 12px;
            color: #128ee9;
        }

        #upfiles {
            width: 70px;
            height: 55px;
            /*background-color:red;*/
            position: absolute;
            z-index: 2100;
            top: 125px;
            left: 585px;
            filter: alpha(opacity=0);
            opacity: 0;
            cursor: pointer;
        }

        #loading {
            position: fixed;
            _position: absolute;
            display: none;
            top: 50%;
            left: 50%;
            width: 124px;
            height: 524px;
            overflow: hidden;
            background: url(../../image/loading.gif) no-repeat;
            z-index: 7;
        }

        #popDiv {
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 185%;
            background-color: black;
            z-index: 2;
            -moz-opacity: 0.7;
            opacity: .70;
            filter: alpha(opacity=5);
        }


    </style>
    <script type="text/javascript">
        //显示加载效果
        function showPopDiv() {
            $("#loading").css("display", "block");
            $("#popDiv").css("display", "block");
        }

        //取消加载效果
        function hiddenPopDiv() {
            $("#loading").css("display", "none");
            $("#popDiv").css("display", "none");
        }

        /**
         * 只能输入数字
         * @param obj
         * @returns
         */
        function repNumber(obj) {
            var reg = /^[\d]+$/g;
            if (!reg.test(obj.value)) {
                var txt = obj.value;
                txt.replace(/[^0-9]+/, function (char, index, val) {//匹配第一次非数字字符
                    obj.value = val.replace(/\D/g, "");//将非数字字符替换成""
                    var rtextRange = null;
                    if (obj.setSelectionRange) {
                        obj.setSelectionRange(index, index);
                    } else {//支持ie
                        rtextRange = obj.createTextRange();
                        rtextRange.moveStart('character', index);
                        rtextRange.collapse(true);
                        rtextRange.select();
                    }
                })
            }
        }
    </script>
</head>

<body>
<div id="popDiv"></div>
<div id="loading"></div>
<section class="aui-content">
    <img alt="" src="../statics/aui/images/regLogo.png"
         style="width: 100%;">
</section>

<form action="../submitapp" method="post"
      id="app" enctype="multipart/form-data">

    <div style="margin-top: 14px;margin-bottom: 10px;margin-left: 15px;">企业信息（请输入真实的企业/公司信息）</div>
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list">
            <li class="aui-list-item   ">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">企业名称</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="s_name" name="s_name" id="s_name"
                               placeholder="请输入您的企业名称">
                    </div>
                </div>
            </li>
            <li class="aui-list-item   ">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">企业简称</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="shopAbbreviation" name="shopAbbreviation"
                               id="shopAbbreviation"
                               placeholder="请输入您的企业简称">
                    </div>
                </div>
            </li>
            <li class="aui-list-item   ">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">企业地址</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="s_addr" name="s_addr" id="s_addr"
                               placeholder="请输入您的企业地址">
                    </div>
                </div>
            </li>
            <li class="aui-list-item   ">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">客服电话</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="telephone" name="telephone" id="telephone"
                               placeholder="请输入您的客服电话">
                    </div>
                </div>
            </li>
            <!-- <li class="aui-list-item   ">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">所属行业</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="industry" name="industry" id="industry"
                               placeholder="请输入所属行业">
                    </div>
                </div>
            </li> -->

            <!--  <li class="aui-list-item   ">
                 <div class="aui-list-item-inner">
                     <div class="aui-list-item-media" style="width: 6rem;">组织代码编号</div>
                     <div class="aui-list-item-inner  ">
                         <input type="text" value="" v-model="license" name="license" id="license"
                                placeholder="请输入组织代码编号">
                     </div>
                 </div>
             </li> -->
        </ul>
    </div>

    <section class="aui-content">
        <ul class="aui-list">
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">联系人姓名</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="username" name="username" id="username"
                               placeholder="请输入您的姓名">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">联系人电话</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="mobile" name="mobile" id="mobile" maxlength="11"
                               placeholder="请输入您的联系电话" onkeyup="repNumber(this)" onchange="checkMobile(this.value)">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">联系人邮箱</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="email" name=email id="email"
                               placeholder="请输入您的联系邮箱">
                    </div>
                </div>
            </li>
        </ul>
    </section>

    <section class="aui-content" style="margin-top: 20px;">
        <ul class="aui-list">
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">法人姓名</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="legalName" name="legalName" id="legalName"
                               placeholder="请输入法人姓名">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">法人身份证号码</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="idCard" name="idCard" id="idCard"
                               placeholder="请输入法人身份证号码">
                    </div>
                </div>
            </li>
        </ul>
    </section>

    <section class="aui-content" style="margin-top: 20px;">
        <ul class="aui-list">
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">结算账户户名</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="bankUser" name="bankUser" id="bankUser"
                               placeholder="请输入结算账户户名">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">结算账户开户行</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="bankName" name="bankName" id="bankName"
                               placeholder="请输入账户开户行（精确到支行）">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-media" style="width: 5rem;">结算账号</div>
                    <div class="aui-list-item-inner  ">
                        <input type="text" value="" v-model="bankCard" name="bankCard" id="bankCard"
                               placeholder="结算账号">
                    </div>
                </div>
            </li>
        </ul>
    </section>


    <div class="aui-content aui-margin-b-15">
        <div style="margin-left: 15px;margin-top: 10px;margin-bottom: 10px;">
            <span>法人身份证原件照</span>
        </div>
        <div>
            <div style="width: 50%; float: left;">
                <center>
                    <img v-model="positiveImg" id="positiveImg" src="../statics/aui/images/sfzzm.png" width="90%"
                         height="100px;">
                </center>
            </div>
            <div style="width: 50%; float: right;">
                <center>
                    <img v-model="oppositeImg" id="oppositeImg" src="../statics/aui/images/sfzfm.png" width="90%"
                         height="100px">
                </center>
            </div>
        </div>

        <div style="height: 40px;">
            <div style="width: 50%; float: left;">
                <center>
                    <input type="file" name="positive" id="positive" style="visibility: hidden; height: 0px;"
                           multiple accept="image/*" capture="camera" onchange="readURL('positiveImg',this)">
                    <input type="button" id="filebutton_sfz" class="aui-btn aui-btn-warning" value="上传身份证正面照"
                           onclick="positive.click()">
                </center>
            </div>
            <div style="width: 50%; float: right;">
                <center>
                    <input type="file" id="opposite" name="opposite" style="visibility: hidden; height: 0px" multiple
                           capture="camera" accept="image/*" onchange="readURL('oppositeImg',this)">
                    <input type="button" id="filebutton_sfzf" class="aui-btn aui-btn-warning" value="上传身份证反面照"
                           onclick="opposite.click()">
                </center>
            </div>
        </div>

        <br/></br>

        <div style="margin-left: 15px;margin-top: 80px;margin-bottom: 10px;">
            <span>营业执照</span>
            <span style="margin-left: 32%;">银行开户许可证</span>
        </div>
        <div>
            <div style="width: 50%; float: left;">
                <center>
                    <img v-model="businessLicenseImg" id="businessLicenseImg" src="../statics/aui/images/dpns.png"
                         width="90%"
                         height="100px;">
                </center>
            </div>
            <div style="width: 50%; float: right;">
                <center>
                    <img v-model="bankLicenseImg" id="bankLicenseImg" src="../statics/aui/images/dpns.png" width="90%"
                         height="100px">
                </center>
            </div>
        </div>

        <div style="height: 40px">
            <div style="width: 50%; float: left;">
                <center>
                    <input type="file" name="businessLicense" id="businessLicense"
                           style="visibility: hidden; height: 0px;"
                           multiple accept="image/*" capture="camera" onchange="readURL('businessLicenseImg',this)">
                    <input type="button" id="filebutton_yyzz" class="aui-btn aui-btn-warning" value="上传营业执照"
                           onclick="businessLicense.click()">
                </center>
            </div>
            <div style="width: 50%; float: right;">
                <center>
                    <input type="file" id="bankLicense" name="bankLicense" style="visibility: hidden; height: 0px"
                           multiple
                           capture="camera" accept="image/*" onchange="readURL('bankLicenseImg',this)">
                    <input type="button" id="filebutton_yhkhxkz" class="aui-btn aui-btn-warning" value="上传银行开户许可证"
                           onclick="bankLicense.click()">
                </center>
            </div>
        </div>

        <div style="margin-left: 15px;margin-top: 130px;margin-bottom: 10px;">
            <span>结算类型</span>
            <span style="margin-left: 3%;">
            		对私结算<input id="dsType" name="jsType" type="radio" value="1" onclick="setType(this.value);"
                               checked="checked">&nbsp;&nbsp;
					对公结算<input id="dgType" name="jsType" type="radio" value="2" onclick="setType(this.value);">
			</span>
        </div>

        <div id="settlementType1" style="display: block;">
            <div style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;"><span>结算人身份证原件照</span></div>
            <div>
                <div style="width: 50%; float: left;padding-top: 0px;">
                    <center>
                        <img v-model="settleUserPositiveImg" id="settleUserPositiveImg"
                             src="../statics/aui/images/sfzzm.png" width="90%"
                             height="100px;">
                    </center>
                </div>
                <div style="width: 50%; float: right;">
                    <center>
                        <img v-model="settleUserOppositeImg" id="settleUserOppositeImg"
                             src="../statics/aui/images/sfzfm.png" width="90%"
                             height="100px">
                    </center>
                </div>
            </div>

            <div style="height: 40px;">
                <div style="width: 50%; float: left;">
                    <center>
                        <input type="file" name="settleUserPositive" id="settleUserPositive" style="visibility: hidden;
	                     height: 0px;" multiple accept="image/*" capture="camera"
                               onchange="readURL('settleUserPositiveImg',this)">
                        <input type="button" id="filebutton_sfz1" class="aui-btn aui-btn-warning" value="上传身份证正面照"
                               onclick="settleUserPositive.click()">
                    </center>
                </div>
                <div style="width: 50%; float: right;">
                    <center>
                        <input type="file" id="settleUserOpposite" name="settleUserOpposite" style="visibility: hidden;
	                            height: 0px" multiple capture="camera" accept="image/*"
                               onchange="readURL('settleUserOppositeImg',this)">
                        <input type="button" id="filebutton_sfzf1" class="aui-btn aui-btn-warning" value="上传身份证反面照"
                               onclick="settleUserOpposite.click()">
                    </center>
                </div>
            </div>

            <div style="margin-top: 130px;margin-bottom: 10px;"></div>
            <div style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;"><span>结算人银行卡原件照</span></div>
            <div>
                <div style="width: 50%; float: left;">
                    <center>
                        <img v-model="settleBankPositiveImg" id="settleBankPositiveImg"
                             src="../statics/aui/images/dpns.png" width="90%"
                             height="100px;">
                    </center>
                </div>
                <div style="width: 50%; float: right;">
                    <center>
                        <img v-model="settleBankOppositeImg" id="settleBankOppositeImg"
                             src="../statics/aui/images/dpns.png" width="90%"
                             height="100px">
                    </center>
                </div>
            </div>

            <div style="height: 40px;">
                <div style="width: 50%; float: left;">
                    <center>
                        <input type="file" name="settleBankPositive" id="settleBankPositive" style="visibility: hidden;
	                     height: 0px;" multiple accept="image/*" capture="camera"
                               onchange="readURL('settleBankPositiveImg',this)">
                        <input type="button" id="filebutton_yhk" class="aui-btn aui-btn-warning" value="上传银行卡正面照"
                               onclick="settleBankPositive.click()">
                    </center>
                </div>
                <div style="width: 50%; float: right;">
                    <center>
                        <input type="file" id="settleBankOpposite" name="settleBankOpposite" style="visibility: hidden;
	                     height: 0px" multiple capture="camera" accept="image/*"
                               onchange="readURL('settleBankOppositeImg',this)">
                        <input type="button" id="filebutton_yhkf" class="aui-btn aui-btn-warning" value="上传银行卡反面照"
                               onclick="settleBankOpposite.click()">
                    </center>
                </div>
            </div>

            <div style="margin-top: 130px;margin-bottom: 10px;"></div>
            <div style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;"><span>结算授权书</span></div>
            <div>
                <div style="width: 50%;">
                    <center>
                        <img v-model="settlementBookImg" id="settlementBookImg" src="../statics/aui/images/dpns.png"
                             width="90%"
                             height="100px;">
                    </center>
                </div>
            </div>

            <div style="height: 40px;">
                <div style="width: 50%; ">
                    <center>
                        <input type="file" name="settlementBook" id="settlementBook" style="visibility: hidden;
	                     height: 0px;" multiple accept="image/*" capture="camera"
                               onchange="readURL('settlementBookImg',this)">
                        <input type="button" id="filebutton_jssfz" class="aui-btn aui-btn-warning" value="上传结算授权书"
                               onclick="settlementBook.click()">
                    </center>
                </div>
            </div>
        </div>



        <div id="settlementType2" style="display: none;">
            <div style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;"><span>结算账户申请书或印鉴卡</span></div>
            <div>
                <div style="width: 50%; ">
                    <center>
                        <img v-model="sealCardImg" id="sealCardImg" src="../statics/aui/images/dpns.png" width="90%"
                             height="100px;">
                    </center>
                </div>
            </div>

            <div style="height: 40px;">
                <div style="width: 50%; ">
                    <center>
                        <input type="file" name="sealCard" id="sealCard" style="visibility: hidden; height: 0px;"
                               multiple accept="image/*" capture="camera" onchange="readURL('sealCardImg',this)">
                        <input type="button" id="filebutton_sqshyjk" class="aui-btn aui-btn-warning" value="上传申请书或印鉴卡"
                               onclick="sealCard.click()">
                    </center>
                </div>
            </div>
        </div>

        <br/>
        <div style="margin-left: 15px;margin-bottom: 10px;margin-top: 10px;">
            <span>企业照片</span>
        </div>
        <div>
            <div style="width: 50%; ">
                <center>
                    <img v-model="outerImg" id="outerImg" src="../statics/aui/images/dpmt.png" width="90%"
                         height="100px;">
                </center>
            </div>
            <!--  <div style="width: 50%; float: right;">
                 <center>
                     <img v-model="doorHeadImg" id="doorHeadImg" src="../statics/aui/images/dpmt.png" width="90%" height="100px;">
                 </center>
             </div> -->
        </div>

        <div style="height: 40px;">
            <div style="width: 50%;">
                <center>
                    <input type="file" id="outer" name="outer" style="visibility: hidden; height: 0px;" multiple
                           capture="camera" accept="image/*" onchange="readURL('outerImg',this)">
                    <input type="button" id="filebutton_dpt" class="aui-btn aui-btn-warning" value="上传企业门头照"
                           onclick="outer.click()">

                </center>
            </div>
            <!--   <div style="width: 50%; float: right;">
                  <center>
                      <input type="file" id="doorHead" name="doorHead" style="visibility: hidden; height: 0px;" multiple
                             capture="camera" accept="image/*" onchange="readURL('doorHeadImg',this)">
                      <input type="button" id="filebutton_dpn" class="aui-btn aui-btn-warning" value="上传企业门头照2" onclick="doorHead.click()">
                  </center>
              </div> -->

        </div>

        <br/></br>
        <div style="margin-left: 5px;margin-bottom: 10px;margin-top: 10px;"></div>
        <!--  <div >
             <div style="width: 50%;margin-top: 80px;">
                 <center>
                     <img v-model="innerImg" id="innerImg" src="../statics/aui/images/dpns.png" width="90%" height="100px;">
                 </center>
             </div>

         </div>

         <div style="height: 40px;">
             <div style="width: 50%; float: left;">
                 <center>
                     <input type="file" id="inner" name="inner" style="visibility: hidden; height: 0px;" multiple
                            capture="camera" accept="image/*" onchange="readURL('innerImg',this)">
                     <input type="button" id="filebutton_dpt" class="aui-btn aui-btn-warning" value="上传企业内景照" onclick="inner.click()">
                 </center>
             </div>
         </div>
         <div style="height: 40px;">
             <div style="width: 50%; float: left;">
                 <center>
                     <input type="file" id="inner" name="inner" style="visibility: hidden; height: 0px;" multiple
                            capture="camera" accept="image/*" onchange="readURL('innerImg',this)">
                     <input type="button" id="filebutton_dpt" class="aui-btn aui-btn-warning" value="上传企业内景照" onclick="inner.click()">
                 </center>
             </div>
         </div> -->

        <div style="margin-left: 15px;">
            <div style="float: left;margin-top: 3px;margin-right: 4px;"><input id="isRead" type="checkbox"
                                                                               style="padding-top: 100px;"></div>
            <span class="weui-agree__text"><font style="color: #999999">阅读并同意</font><a
                    href="javascript:void(0);">《相关条款》</a></span>
        </div>
    </div>
    <section class="aui-content"
             style="margin-top: 14px; padding-left: 20px; padding-right: 20px;">
        <p><!-- #03a9f4 -->
            <input type="button" id="subButton" class="aui-btn aui-btn-info  aui-btn-block" onclick="sureapp();"
                   value="入驻申请">
        </p>
    </section>
</form>

<div id="dialogs">
    <div class="js_dialog" id="iosDialog2" style="display: none;">
        <div class="weui-mask"></div>
        <div class="weui-dialog">
            <div class="weui-dialog__bd" id="DialogMessage"></div>
            <div class="weui-dialog__ft">
                <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary DeleteDefault">确定</a>
            </div>
        </div>
    </div>
</div>

<br/>
<br/>
<br/>
<br/>

<script type="text/javascript">

    var $iosDialog2 = $('#iosDialog2');
    $('#dialogs').on('click', '.DeleteDefault', function () { //取消按钮事件
        $(this).parents('.js_dialog').fadeOut(200);
    });

    /**
     * 入驻申请
     */

    function checkMobile(mobile) {
        $.ajax({
            type: "POST",
            url: "../auth/checkMobile",
            data: {mobile: mobile},
            success: function (r) {
                var result = JSON.parse(r);
                if (result.code == '500') {
                    $("#DialogMessage").html(result.msg);
                    $iosDialog2.fadeIn(200);

                    $('#subButton').attr('disabled', true);
                    $('#subButton').removeClass("aui-btn-info");
                } else if (result.code == '0') {
                    $('#subButton').removeAttr("disabled");
                    $('#subButton').addClass("aui-btn-info");
                }
            }
        });
    }

    function sureapp() {
        var s_name = $("#s_name").val();
        var shopAbbreviation = $("#shopAbbreviation").val();
        var s_addr = $("#s_addr").val();
        var telephone = $("#telephone").val();

        var username = $("#username").val();
        var mobile = $("#mobile").val();
        var email = $("#email").val();

        var legalName = $("#legalName").val();
        var idCard = $("#idCard").val();

        var bankUser = $("#bankUser").val();
        var bankName = $("#bankName").val();
        var bankCard = $("#bankCard").val();

        var positive = $("#positive").val();
        var opposite = $("#opposite").val();
        var outer = $("#outer").val();
        var inner = $("#inner").val();

        var doorHead = $("#doorHead").val();//店铺门头照
        var businessLicense = $("#businessLicense").val();//营业执照
        var bankLicense = $("#bankLicense").val();//银行开户许可证
        var settlementBook = $("#settlementBook").val();//结算授权书
        var settleUserPositive = $("#settleUserPositive").val();//结算人身份证正面
        var settleUserOpposite = $("#settleUserOpposite").val();//结算人身份证反面
        var settleBankPositive = $("#settleBankPositive").val();//结算人银行卡正面
        var settleBankOpposite = $("#settleBankOpposite").val();//结算人银行卡反面
        var sealCard = $("#sealCard").val();//账户申请书或印鉴卡

        var settleType = $('input:radio:checked').val()

        if (s_name.trim().length == 0) {
            $("#DialogMessage").html("请填写企业名称");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (shopAbbreviation.trim().length == 0) {
            $("#DialogMessage").html("请填写企业简称");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (s_addr.trim().length == 0) {
            $("#DialogMessage").html("请填写企业地址");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (telephone.trim().length == 0) {
            $("#DialogMessage").html("请填写客服电话");
            $iosDialog2.fadeIn(200);
            return;
        }

        if (username.trim().length == 0) {
            $("#DialogMessage").html("请填写联系人姓名");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (mobile.trim().length == 0) {
            $("#DialogMessage").html("请填写联系人电话");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (email.trim().length == 0) {
            $("#DialogMessage").html("请填写联系人邮箱");
            $iosDialog2.fadeIn(200);
            return;
        }else if (!(/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(email))) {
        	$("#DialogMessage").html("邮箱填写的不对正确，请正确填写");
            $iosDialog2.fadeIn(200);
            return ;
		}

        if (legalName.trim().length == 0) {
            $("#DialogMessage").html("请填写法人姓名");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (idCard.trim().length == 0) {
            $("#DialogMessage").html("请填写法人身份证号码");
            $iosDialog2.fadeIn(200);
            return;
        }

        if (bankUser.trim().length == 0) {
            $("#DialogMessage").html("请填写结算账户户名");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (bankName.trim().length == 0) {
            $("#DialogMessage").html("请填写账户开户行名称");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (bankCard.trim().length == 0) {
            $("#DialogMessage").html("请填写结算帐号");
            $iosDialog2.fadeIn(200);
            return;
        }

        if (positive.trim().length == 0) {
            $("#DialogMessage").html("请上传法人身份证正面照");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (opposite.trim().length == 0) {
            $("#DialogMessage").html("请上传法人身份证反面照");
            $iosDialog2.fadeIn(200);
            return;
        }

        if (businessLicense.trim().length == 0) {
            $("#DialogMessage").html("请上传营业执照");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (bankLicense.trim().length == 0) {
            $("#DialogMessage").html("请上传银行开户许可证");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (settleType == 1) {
            if (settleUserPositive.trim().length == 0) {
                $("#DialogMessage").html("请上传结算人身份证正面照");
                $iosDialog2.fadeIn(200);
                return;
            }
            if (settleUserOpposite.trim().length == 0) {
                $("#DialogMessage").html("请上传结算人身份证反面照");
                $iosDialog2.fadeIn(200);
                return;
            }
            if (settleBankPositive.trim().length == 0) {
                $("#DialogMessage").html("请上传结算人银行卡正面照");
                $iosDialog2.fadeIn(200);
                return;
            }
            if (settleBankOpposite.trim().length == 0) {
                $("#DialogMessage").html("请上传结算人银行卡反面照");
                $iosDialog2.fadeIn(200);
                return;
            }
            if (settlementBook.trim().length == 0) {
                $("#DialogMessage").html("请上传结算授权书");
                $iosDialog2.fadeIn(200);
                return;
            }
        } else if (settleType == 2) {
            if (sealCard.trim().length == 0) {
                $("#DialogMessage").html("请上传账户申请书或印鉴卡");
                $iosDialog2.fadeIn(200);
                return;
            }
        }

        if (outer.trim().length == 0) {
            $("#DialogMessage").html("请上传企业门头照");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (!$('#isRead').is(':checked')) {
            $("#DialogMessage").html("请阅读并同意相关条款");
            $iosDialog2.fadeIn(200);
            return;
        }
        /* if (doorHead.trim().length == 0) {
            $("#DialogMessage").html("请上传企业门头照2");
            $iosDialog2.fadeIn(200);
            return;
        }
        if (inner.trim().length == 0) {
            $("#DialogMessage").html("请上传企业内景照");
            $iosDialog2.fadeIn(200);
            return;
        } */
        showPopDiv();
        document.getElementById("app").submit();
    }


</script>
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
    function readURL(outerImg, input) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            reader.onload = function (e) {
                document.getElementById(outerImg).src = e.target.result;
            }
            reader.readAsDataURL(input.files[0]);
        }
    }

    function setType(value) {
        if (value == 1) {
            $('#settlementType1').show();
            $('#settlementType2').hide();
        } else if (value == 2) {
            $('#settlementType2').show();
            $('#settlementType1').hide();
        }
    }

</script>
